package helper;

public class Maths {

	public static void main(String[] args) {
		double x = (2.0 / 4.0);
		double y = (49.0 / 100.0);
		Maths.calcDist(x, y);
		Maths.method(x, y);
		for (int i = 1; i <= 10; i++) {
			Maths.calcR(i, 10);
		}
	}

	public static double calcDist(double x, double y) {
		double d = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
		if (d >= 1) {
			System.out.println("d larger than 1!!");
			System.exit(0);
			return 0;
		} else {
			System.out.println("Distance " + d);
			return d;
		}
	}

	public static void method(double x, double y) {
		double squares = Math.pow(x, 2) + Math.pow(y, 2);
		System.out.println(squares);
		int i = (int) (10 * squares) + 1;
		System.out.println(i);
	}

	public static void calcR(double index, int segments) {
		double r = Math.sqrt(index / segments);
		double r0 = Math.sqrt((index - 1) / segments);
		System.out.println("Radius index: " + index + ", length: [" + r0
				+ " - " + r + ")");
	}
}
